<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>InputBox</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../styles/styles.css">
<script language="javascript" src='../links.js' type="text/javascript"></script>
</head>

<body>

<h1>InputBox</h1>
<div class=navbar>
<a href="../index.html">main</a> |
<a href="index.html">service functions</a><br>
</div>

<div class=shortdescr>
The <dfn>InputBox</dfn> function displays a simple dialog box allowing to enter one line of text.
</div>

<pre class=syntax>
int WINAPI InputBox(
  const char *Title,
  const char *Prompt,
  const char *HistoryName,
  const char *SrcText,
  char *DestText,
  int   DestLength,
  const char *HelpTopic,
  DWORD Flags
);
</pre>
<h3>Parameters</h3>
<div class=descr>
    <div class=dfn>Title</div>
    <div class=dfndescr>Iput dialog title. Can be NULL or "".</div>

    <div class=dfn>Prompt</div>
    <div class=dfndescr>Prompt text (text above the input line). Can be NULL or "".</div>

    <div class=dfn>HistoryName</div>
    <div class=dfndescr>Name of the "history" record for the input line. Set to NULL if history is not needed.</div>

    <div class=dfn>SrcText</div>
    <div class=dfndescr>The initial value of the input line. Can be NULL or "".</div>

    <div class=dfn>DestText</div>
    <div class=dfndescr>Points to the result string. Can point to the same buffer as <dfn>SrcText</dfn>, but you must reserve enough space.</div>

    <div class=dfn>DestLength</div>
    <div class=dfndescr>Size of destination buffer.</div>

    <div class=dfn>HelpTopic</div>
    <div class=dfndescr><a href="../language/helptopic.html">Help topic</a> for the inputbox
     in the format of "&lt;FullPath&gt;Topic", e.g.:
     <pre class=code>"&lt;D:\\FAR\\Plugins\\Foo\\&gt;FooInfo"</pre>
     <br>Set to NULL if help is not used.
    </div>

    <div class=dfn>Flags</div>
    <div class=dfndescr>Can be a combination of the following values (<a name="INPUTBOXFLAGS">INPUTBOXFLAGS</a> enum):
        <table class="cont"><tr class="cont"><th class="cont" width="40%">Constant</th><th class="cont" width="60%">Description</th></tr>
           <tr class="cont"><td class="cont" width="40%"><a name="FIB_ENABLEEMPTY">FIB_ENABLEEMPTY</a></td>
           <td class="cont" width="60%">the function will return true even if the input line is empty.</td></tr>
           <tr class="cont"><td class="cont" width="40%"><a name="FIB_PASSWORD">FIB_PASSWORD</a></td>
           <td class="cont" width="60%">used to input passwords - entered text is represented by <code>'*'</code> on the screen.</td></tr>
           <tr class="cont"><td class="cont" width="40%"><a name="FIB_EXPANDENV">FIB_EXPANDENV</a></td>
           <td class="cont" width="60%">after a successful return, any environment variables
           present in the input line will be replaced by their values in the <dfn>DestText</dfn>
           buffer, e.g. if the user entered '<code>%TEMP%</code>', then <dfn>DestText</dfn> will
           contain '<code>C:\TEMP</code>'.</td></tr>
           <tr class="cont"><td class="cont" width="40%"><a name="FIB_NOUSELASTHISTORY">FIB_NOUSELASTHISTORY</a></td>
           <td class="cont" width="60%">if SrcText is empty and HistoryName is not NULL, then do not initialize the input line from the history.</td></tr>
           <tr class="cont"><td class="cont" width="40%"><a name="FIB_BUTTONS">FIB_BUTTONS</a></td>
           <td class="cont" width="60%">displays a separator and the [OK] and [Cancel] buttons below the input line. The dialog will grow by 2 lines.</td></tr>
           <tr class="cont"><td class="cont" width="40%"><a name="FIB_NOAMPERSAND">FIB_NOAMPERSAND</a></td>
           <td class="cont" width="60%">the ampersand character will not be shown in the prompt string but can instead be used to define a hotkey.</td></tr>
        </table>
    </div>
</div>

<h3>Return value</h3>
<div class=descr>
  The function returns TRUE in case of successful user input, and FALSE in case of user
  interruption.
</div>

<h3>Remarks</h3>
<div class=descr>
FAR Manager uses this function to promt the user when creating a folder:<br>
<img src="../../images/inputbox.gif">
</div>

<h3>Example</h3>
<div class=descr>
</div>

<div class=see>See also:</div><div class=seecont>
<a href="../dialogapi/dialog.html">Dialog</a>
</div>

</body>
</html>